﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace System.IO
{
    public abstract class AbstractFileSystemInfo
    {
        public abstract bool SupportsAsync { get; }

        public abstract bool SupportSync { get; }

        public virtual bool SupportsWrites { get { return true; } }

        public virtual bool SupportsCreates { get { return SupportsWrites; } }

        public virtual bool SupportsDeletes { get { return SupportsWrites; } }

        #region Async

        public abstract void DeleteAsync(Action<Exception> errorCallback);

        public abstract void GetExistsAsync(Action<bool> callback);

        public abstract void LoadInfo(Action<bool> callback);

        #endregion Async

        public abstract void Delete();

        public abstract bool Exists { get; }

        public abstract string Name { get; }

        public virtual DateTime CreationTime { get { return DateTime.Now; } }

        public virtual string Extension
        {
            get
            {
                return System.IO.Path.GetExtension(FullName);
            }
        }

        public abstract string FullName { get; }

        public virtual DateTime LastAccessTime { get { return DateTime.Now; } }

        public virtual DateTime LastWriteTime { get { return DateTime.Now; } }

        public virtual void Refresh() { }

        public virtual System.IO.FileAttributes Attributes
        {
            get
            {
                return FileAttributes.Normal;
            }
            set
            {
#if DEBUG
                throw new NotImplementedException("Can't set file attributes via abstracted FS");
#endif
            }
        }
    }
}